FROM jenkins:latest

ENV JENKINS_HOME /var/jenkins_home
ENV JENKINS_SLAVE_AGENT_PORT 50000

# Jenkins is ran with user `root`, so can operate docker
USER root

RUN apt-get update \
&& apt-get install -y sudo \
&& rm -rf /var/lib/apt/lists/*

RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers

#加上host
RUN echo "192.168.80.148	99fu.cn" >> /etc/hosts

USER jenkins

#RUN sudo cat /etc/sudoers

COPY plugins.txt /usr/share/jenkins/plugins.txt

RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

